<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <!-- <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="消防员姓名" prop="firefighterName">
        <el-input
          v-model="queryParams.firefighterName"
          placeholder="请输入"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="单杠卷身上" prop="trainingProgram">
        <el-input
          v-model="queryParams.trainingProgram"
          placeholder="请输入单杠卷身上"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="双杠臂屈伸" prop="trainingProgram1">
        <el-input
          v-model="queryParams.trainingProgram1"
          placeholder="请输入双杠臂屈伸"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="负重深蹲" prop="trainingProgram2">
        <el-input
          v-model="queryParams.trainingProgram2"
          placeholder="请输入负重深蹲"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="爬杆" prop="trainingProgram3">
        <el-input
          v-model="queryParams.trainingProgram3"
          placeholder="请输入爬杆"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="100米跑" prop="trainingProgram4">
        <el-input
          v-model="queryParams.trainingProgram4"
          placeholder="请输入100米跑"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5000米跑" prop="trainingProgram5">
        <el-input
          v-model="queryParams.trainingProgram5"
          placeholder="请输入5000米跑"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5×25米折返跑" prop="trainingProgram6">
        <el-input
          v-model="queryParams.trainingProgram6"
          placeholder="请输入5×25米折返跑"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="游泳" prop="trainingProgram7">
        <el-input
          v-model="queryParams.trainingProgram7"
          placeholder="请输入游泳"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="百米负重跑" prop="trainingProgram8">
        <el-input
          v-model="queryParams.trainingProgram8"
          placeholder="请输入百米负重跑"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="负重登10楼" prop="trainingProgram9">
        <el-input
          v-model="queryParams.trainingProgram9"
          placeholder="请输入负重登10楼"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="400米救人疏散物资" prop="trainingProgram10">
        <el-input
          v-model="queryParams.trainingProgram10"
          placeholder="请输入400米救人疏散物资"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="爬绳上四楼" prop="trainingProgram11">
        <el-input
          v-model="queryParams.trainingProgram11"
          placeholder="请输入爬绳上四楼"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="百米消防障碍" prop="trainingProgram12">
        <el-input
          v-model="queryParams.trainingProgram12"
          placeholder="请输入百米消防障碍"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="60米肩梯" prop="trainingProgram13">
        <el-input
          v-model="queryParams.trainingProgram13"
          placeholder="请输入60米肩梯"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="搬运重物折返跑" prop="trainingProgram14">
        <el-input
          v-model="queryParams.trainingProgram14"
          placeholder="请输入搬运重物折返跑"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item label="录入时间" prop="entryDate">
        <el-date-picker clearable
          v-model="queryParams.entryDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择录入时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:FirefighterTrainingTable:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:FirefighterTrainingTable:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:FirefighterTrainingTable:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:FirefighterTrainingTable:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="FirefighterTrainingTableList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <!-- <el-table-column label="用户ID" align="center" prop="userId" /> -->
      <el-table-column label="消防员姓名" align="center" prop="firefighterName" />
      <el-table-column label="100米跑" align="center" prop="trainingProgram4" />
      <!-- <el-table-column label="100米跑" align="center" prop="trainingProgram4Name" /> -->

      <el-table-column label="5000米跑" align="center" prop="trainingProgram5" />

      <el-table-column label="游泳" align="center" prop="trainingProgram7" />

      <el-table-column label="5×25米折返跑" align="center" prop="trainingProgram6" />

      <el-table-column label="单杠卷身上" align="center" prop="trainingProgram" />

      <el-table-column label="双杠臂屈伸" align="center" prop="trainingProgram1" />

      <el-table-column label="百米负重跑" align="center" prop="trainingProgram8" />

      <el-table-column label="负重登10楼" align="center" prop="trainingProgram9" />

      <el-table-column label="400米救人疏散物资" align="center" prop="trainingProgram10" />

      <el-table-column label="爬绳上四楼" align="center" prop="trainingProgram11" />

      <el-table-column label="百米消防障碍" align="center" prop="trainingProgram12" />

      <el-table-column label="60米肩梯" align="center" prop="trainingProgram13" />

      <el-table-column label="搬运重物折返跑" align="center" prop="trainingProgram14" />

      <el-table-column label="负重深蹲" align="center" prop="trainingProgram2" />

      <el-table-column label="爬杆" align="center" prop="trainingProgram3" />

      <el-table-column label="录入时间" align="center" prop="entryDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.entryDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:FirefighterTrainingTable:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:FirefighterTrainingTable:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改体能科目训练登记对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <!-- <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item> -->
        <el-form-item label="消防员证件号" prop="firefighterIdCard">
          <el-input v-model="form.firefighterIdCard" placeholder="请输入消防员证件号" @change="getFirefighterIdCard" />
        </el-form-item>
        <el-form-item label="消防员姓名" prop="firefighterName">
          <el-input v-model="form.firefighterName" placeholder="请输入" />
        </el-form-item>

        <el-form-item label="单杠卷身上(个)" prop="trainingProgram">
          <el-input v-model="form.trainingProgram" placeholder="请输入单杠卷身上（x个）" />
        </el-form-item>
        <el-form-item label="双杠臂屈伸（个）" prop="trainingProgram1">
          <el-input v-model="form.trainingProgram1" placeholder="请输入双杠臂屈伸（x个）" />
        </el-form-item>
        <el-form-item label="负重深蹲（个）" prop="trainingProgram2">
          <el-input v-model="form.trainingProgram2" placeholder="请输入负重深蹲（x个）"  />
        </el-form-item>
        <el-form-item label="爬杆（趟）" prop="trainingProgram3">
          <el-input v-model="form.trainingProgram3" placeholder="请输入爬杆（x趟）" />
        </el-form-item>
        <el-form-item label="100米跑" prop="trainingProgram4">
          <el-input v-model="form.trainingProgram4" placeholder="请输入100米跑（x秒）" />
        </el-form-item>
        <el-form-item label="5000米跑（分）" prop="trainingProgram5">
          <el-input v-model="form.trainingProgram5" placeholder="请输入5000米跑（00:00）"  />
        </el-form-item>
        <el-form-item label="5×25米折返跑（秒）" prop="trainingProgram6">
          <el-input v-model="form.trainingProgram6" placeholder="请输入5×25米折返跑（x秒）"  />
        </el-form-item>
        <el-form-item label="200米游泳（分）" prop="trainingProgram7">
          <el-input v-model="form.trainingProgram7" placeholder="请输入游泳（x分）"  />
        </el-form-item>
        <el-form-item label="百米负重跑" prop="trainingProgram8">
          <el-input v-model="form.trainingProgram8" placeholder="请输入百米负重跑（x秒）" />
        </el-form-item>
        <el-form-item label="负重登10楼（秒）" prop="trainingProgram9">
          <el-input v-model="form.trainingProgram9" placeholder="请输入负重登10楼（x秒）"  />
        </el-form-item>
        <el-form-item label="400米救人疏散物资" prop="trainingProgram10">
          <el-input v-model="form.trainingProgram10" placeholder="请输入400米救人疏散物资（x秒）" />
        </el-form-item>
        <el-form-item label="爬绳上四楼" prop="trainingProgram11">
          <el-input v-model="form.trainingProgram11" placeholder="请输入爬绳上四楼（秒）" />
        </el-form-item>
        <el-form-item label="百米消防障碍" prop="trainingProgram12">
          <el-input v-model="form.trainingProgram12" placeholder="请输入百米消防障碍（秒）"  />
        </el-form-item>
        <el-form-item label="60米肩梯" prop="trainingProgram13">
          <el-input v-model="form.trainingProgram13" placeholder="请输入60米肩梯（x个）"  />
        </el-form-item>
        <el-form-item label="搬运重物折返跑（秒）" prop="trainingProgram14">
          <el-input v-model="form.trainingProgram14" placeholder="请输入搬运重物折返跑（x个）"  />
        </el-form-item>

        <el-form-item label="录入时间" prop="entryDate">
          <el-date-picker clearable
            v-model="form.entryDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择录入时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listFirefighterTrainingTable, getFirefighterTrainingTable, delFirefighterTrainingTable, addFirefighterTrainingTable, updateFirefighterTrainingTable,getFirefighterIdCard,getNameAge } from "@/api/firefighterTrainingTable/FirefighterTrainingTable";

export default {
  name: "FirefighterTrainingTable",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 体能科目训练登记表格数据
      FirefighterTrainingTableList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        firefighterName: null,
        trainingProgram: null,
        trainingProgram1: null,
        trainingProgram2: null,
        trainingProgram3: null,
        trainingProgram4: null,
        trainingProgram5: null,
        trainingProgram6: null,
        trainingProgram7: null,
        trainingProgram8: null,
        trainingProgram9: null,
        trainingProgram10: null,
        trainingProgram11: null,
        trainingProgram12: null,
        trainingProgram13: null,
        trainingProgram14: null,
        entryDate: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
       
      },
      show: true,
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getFirefighterIdCard(nameId) {
				console.log("获取证件号：", nameId)
				getNameAge(nameId).then(res => {
					console.log("姓名/年龄：", res.data.nameAndAge)
					this.form.firefighterName = res.data.nameAndAge.name
          this.form.age = res.data.nameAndAge.age
          this.form.sex = res.data.nameAndAge.sex
				})
			},
    /** 查询体能科目训练登记列表 */
    getList() {
      this.loading = true;
      listFirefighterTrainingTable(this.queryParams).then(response => {
        this.FirefighterTrainingTableList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        userId: null,
        firefighterName:  null,
        trainingProgram:  null,
        trainingProgram1: null,
        trainingProgram2: null,
        trainingProgram3: null,
        trainingProgram4: null,
        trainingProgram5: null,
        trainingProgram6: null,
        trainingProgram7: null,
        trainingProgram8: null,
        trainingProgram9: null,
        trainingProgram10: null,
        trainingProgram11: null,
        trainingProgram12: null,
        trainingProgram13: null,
        trainingProgram14: null,
        entryDate: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加体能科目训练登记";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getFirefighterTrainingTable(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改体能科目训练登记";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateFirefighterTrainingTable(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            this.show = false
            this.oneGrades(this.form.trainingProgram)
            this.twoGrades(this.form.trainingProgram1)
            this.threeGrades(this.form.trainingProgram2)
            this.fourGrades(this.form.trainingProgram3)
            this.fiveGrades(this.form.trainingProgram4)
            this.sixGrades(this.form.trainingProgram5)
            this.sevenGrades(this.form.trainingProgram6)
            this.eightGrades(this.form.trainingProgram7)
            this.nineGrades(this.form.trainingProgram8)
            this.tenGrades(this.form.trainingProgram9)
            this.elevenGrades(this.form.trainingProgram10)
            this.twelveGrades(this.form.trainingProgram11)
            this.thirteenGrades(this.form.trainingProgram12)
            this.fourteenGrades(this.form.trainingProgram13)
            this.fifteenGrades(this.form.trainingProgram14)
            console.log("form:", this.form)
            addFirefighterTrainingTable(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.true = true
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除体能科目训练登记编号为"' + ids + '"的数据项？').then(function() {
        return delFirefighterTrainingTable(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/FirefighterTrainingTable/export', {
        ...this.queryParams
      }, `FirefighterTrainingTable_${new Date().getTime()}.xlsx`)
    },
    ge(e){
      return Number(e.match(/\d+/)[0]);
    },
    oneGrades(e){
      const grades = this.ge(e)
      console.log("单杠卷身上：",grades)
      if(grades >= 22){
        this.form.trainingProgram = e + ' | ' + 100 + '分'
        return
      }else if(grades >= 20){
        this.form.trainingProgram = e + ' | ' + 95 + '分'
        return
      }else if(grades >= 18){
        this.form.trainingProgram = e + ' | ' + 90 + '分'
        return
      }else if(grades >= 16){
        this.form.trainingProgram = e + ' | ' + 85 + '分'
        return
      }else if(grades >= 14){
        this.form.trainingProgram = e + ' | ' + 80 + '分'
        return
      }else if(grades >= 12){
        this.form.trainingProgram = e + ' | ' + 75 + '分'
        return
      }else if(grades >= 10){
        this.form.trainingProgram = e + ' | ' + 70 + '分'
        return
      }else if(grades >= 8){
        this.form.trainingProgram = e + ' | ' + 65 + '分'
        return
      }else if(grades >= 6){
        this.form.trainingProgram = e + ' | ' + 60 + '分'
        return
      }else{
        this.form.trainingProgram = e + ' | ' + 59 + '分'
        return
      }
    },
    twoGrades(e){
      // console.log( this.ge(e))
      const grades = this.ge(e)
      console.log("双杠臂屈伸：",grades)
      // this.FirefighterTrainingTableList.trainingProgram1Name = e
      if(grades >= 50){
        this.form.trainingProgram1 = e + ' | ' + 100 + '分'
        return
      }else if(grades >= 40){
        this.form.trainingProgram1 = e + ' | ' + 80 + '分'
        return
      }else if(grades >= 30){
        this.form.trainingProgram1 = e + ' | ' + 60 + '分'
        return
      }else{
        this.form.trainingProgram1 = e + ' | ' + 59 + '分'
        return
      }
    },
    threeGrades(e){ 
      console.log( this.ge(e))
      const grades = this.ge(e)
      console.log("负重深蹲",grades)
      // this.FirefighterTrainingTableList.trainingProgram2Name = grades
      if(grades >= 48){
        this.form.trainingProgram2 = e + ' | ' + 100 + '分'

        return
      }else if(grades >= 44){
        this.form.trainingProgram2 = e + ' | ' + 95 + '分'
        return
      }else if(grades >= 40){
        this.form.trainingProgram2 = e + ' | ' + 90 + '分'
        return
      }else if(grades >= 36){
        this.form.trainingProgram2 = e + ' | ' + 85 + '分'
        return
      }else if(grades >= 32){
        this.form.trainingProgram2 = e + ' | ' + 80 + '分'
        return
      }else if(grades >= 28){
        this.form.trainingProgram2 = e + ' | ' + 75 + '分'
        return
      }else if(grades >= 24){
        this.form.trainingProgram2 = e + ' | ' + 70 + '分'
        return
      }else if(grades >= 20){
        this.form.trainingProgram2 = e + ' | ' + 65 + '分'
        return
      }else if(grades >= 16){
        this.form.trainingProgram2 = e + ' | ' + 60 + '分'
        return
      }else{
        this.form.trainingProgram2 = e + ' | ' + 59 + '分'
        return
      }
    },
    fourGrades(e){ 
      console.log( this.ge(e))
      const grades = this.ge(e)
      console.log("爬杆",grades)
      // this.FirefighterTrainingTableList.trainingProgram3Name = grades
      if(grades >= 6){
        this.form.trainingProgram3 = e + ' | ' +  100 + '分'
        return
      }else if(grades >= 5){
        this.form.trainingProgram3 = e + ' | ' +  90 + '分'
        return
      }else if(grades >= 4){
        this.form.trainingProgram3 = e + ' | ' +  80 + '分'
        return
      }else if(grades >= 3){
        this.form.trainingProgram3 = e + ' | ' +  70 + '分'
        return
      }else if(grades >= 2){
        this.form.trainingProgram3 = e + ' | ' +  60 + '分'
        return
      }else{
        this.form.trainingProgram3 = e + ' | ' + 59
        return
      }
    },
    fiveGrades(e){ 
      // console.log( this.ge(e))
      // const grades = this.ge(e)
      // console.log("100米跑",grades)
      // this.FirefighterTrainingTableList.trainingProgram3Name = grades
      this.form.trainingProgram4 = e + ' | ' + e + '分'
    },
    sixGrades(e){ 
      console.log(e)
      const [minutes, seconds] = e.split(':').map(Number);
      const grades = minutes * 60 + seconds;
      console.log("5000米跑（分）",grades)
     
      // this.FirefighterTrainingTableList.trainingProgram3Name = grades
      if(grades > 1560){
        this.form.trainingProgram5 = e + ' | ' + 60 + '分'
        return
      }else if(grades > 1530){
        this.form.trainingProgram5 = e + ' | ' + 60 + '分'
        return
        
      }else if(grades > 1500){
        this.form.trainingProgram5 = e + ' | ' + 65 + '分'
        return
        
      }else if(grades > 1470){
        this.form.trainingProgram5 = e + ' | ' + 70 + '分'
        return
        
      }else if(grades > 1440){
        this.form.trainingProgram5 = e + ' | ' + 75 + '分'
        return
        
      }else if(grades > 1410){
        this.form.trainingProgram5 = e + ' | ' + 80 + '分'
        return
        
      }else if(grades > 1380){
        this.form.trainingProgram5 = e + ' | ' + 85 + '分'
        return
        
      }else if(grades > 1350){
        this.form.trainingProgram5 = e + ' | ' + 90 + '分'
        return
        
      }else if(grades > 1320){
        this.form.trainingProgram5 = e + ' | ' + 95 + '分'
        return
        
      }else{
        console.log("",e + ' ' + 100)
        this.form.trainingProgram5 = e + ' | ' + 100 + '分'
        return
      }
    },
    sevenGrades(e){ 
      console.log( this.ge(e))
      const grades = this.ge(e)
      console.log("5×25米折返跑（秒）",grades)
      
      if(grades >= 38){
        this.form.trainingProgram6 = e + ' | ' + 60 + '分'
        return
      }else if(grades > 37){
        this.form.trainingProgram6 = e + ' | ' + 60 + '分'
        return
        
      }else if(grades > 36){
        this.form.trainingProgram6 = e + ' | ' + 65 + '分'
        return
        
      }else if(grades > 35){
        this.form.trainingProgram6 = e + ' | ' + 70 + '分'
        return
        
      }else if(grades > 34){
        this.form.trainingProgram6 = e + ' | ' + 75 + '分'
        return
        
      }else if(grades > 33){
        this.form.trainingProgram6 = e + ' | ' + 80 + '分'
        return
        
      }else if(grades > 32){
        this.form.trainingProgram6 = e + ' | ' + 85 + '分'
        return
        
      }else if(grades > 31){
        this.form.trainingProgram6 = e + ' | ' + 90 + '分'
        return
        
      }else if(grades > 30){
        this.form.trainingProgram6 = e + ' | ' + 95 + '分'
        return
      }else{
        this.form.trainingProgram6 = e + ' | ' + 100 + '分'
        return
      }
    },
    eightGrades(e){ 
      // console.log( this.ge(e))
      // trainingProgram7
      const grades = this.ge(e)
      console.log("200米游泳（分）",grades)
      if(grades >= 4){
        this.form.trainingProgram7 = e + ' | ' + 60 + '分'
          return
      }else if(grades > 3){
        this.form.trainingProgram7 = e + ' | ' + 80 + '分'
        return
        
      }else{
        this.form.trainingProgram7 = e + ' | ' + 100 + '分'
        return
        
      }
    },
    nineGrades(e){ 
      // console.log( this.ge(e))
      // trainingProgram8
      this.form.trainingProgram8 = e + ' | ' + e + '分'
    },
    tenGrades(e){ 
      console.log( this.ge(e))
      // trainingProgram9
      // const [minutes, seconds] = e.split(':').map(Number);
      // const grades = minutes * 60 + seconds;
      const grades = this.ge(e)
      // console.log(grades)
      console.log("负重登10楼（秒）",grades)
      if(grades > 58){
        this.form.trainingProgram9 = e + ' | ' + 60 + '分'
        return
      }else if(grades > 90){
        this.form.trainingProgram9 = e + ' | ' + 60 + '分'
        return
        
      }else if(grades > 80){
        this.form.trainingProgram9 = e + ' | ' + 65 + '分'
        return
        
      }else if(grades > 75){
        this.form.trainingProgram9 = e + ' | ' + 70 + '分'
        return
        
      }else if(grades > 70){
        this.form.trainingProgram9 = e + ' | ' + 75 + '分'
        return
        
      }else if(grades > 65){
        this.form.trainingProgram9 = e + ' | ' + 80 + '分'
        return
        
      }else if(grades > 60){
        this.form.trainingProgram9 = e + ' | ' + 85 + '分'
        return
        
      }else if(grades > 55){
        this.form.trainingProgram9 = e + ' | ' + 90 + '分'
        return
        
      }else if(grades > 50){
        this.form.trainingProgram9 = e + ' | ' + 95 + '分'
        return
        
      }else{
        this.form.trainingProgram9 = e + ' | ' + 100 + '分'
        return
      }

    },
    elevenGrades(e){ 
      // console.log( this.ge(e))
      // trainingProgram10
      this.form.trainingProgram10 = e + ' | ' + e + '分'
    },
    twelveGrades(e){ 
      // console.log( this.ge(e))
      // trainingProgram11
      this.form.trainingProgram11 = e + ' | ' + e + '分'
      
    },
    thirteenGrades(e){ 
      // console.log( this.ge(e))
      // trainingProgram12
      this.form.trainingProgram12 = e + ' | ' + e + '分'
    },
    fourteenGrades(e){ 
      // console.log( this.ge(e))
      // trainingProgram13
      this.form.trainingProgram13 = e + ' | ' + e + '分'
    },
    fifteenGrades(e){ 
      console.log( this.ge(e))
      // trainingProgram14
      const grades = this.ge(e)
      console.log("搬运重物折返跑（秒）",grades)
      if(grades > 58){
        this.form.trainingProgram14 = e + ' | ' + 60 + '分'
        return
      }else if(grades > 56){
        this.form.trainingProgram14 = e + ' | ' + 60 + '分'
        return
        
      }else if(grades > 54){
        this.form.trainingProgram14 = e + ' | ' + 65 + '分'
        return
        
      }else if(grades > 52){
        this.form.trainingProgram14 = e + ' | ' + 70 + '分'
        return
        
      }else if(grades > 50){
        this.form.trainingProgram14 = e + ' | ' + 75 + '分'
        return
        
      }else if(grades > 48){
        this.form.trainingProgram14 = e + ' | ' + 80 + '分'
        return
        
      }else if(grades > 48){
        this.form.trainingProgram14 = e + ' | ' + 85 + '分'
        return
        
      }else if(grades > 47){
        this.form.trainingProgram14 = e + ' | ' + 90 + '分'
        return
        
      }else if(grades > 46){
        this.form.trainingProgram14 = e + ' | ' + 95 + '分'
        return
        
      }else{
        this.form.trainingProgram14 = e + ' | ' + 100 + '分'
        return
      }
    },

  }
};
</script>
